﻿namespace Pub.Class
{
    using System;

    public sealed class SingletonAddIn<T> where T: IAddIn
    {
        public static T Instance(string classNameAndAssembly)
        {
            return (T) classNameAndAssembly.LoadClass();
        }

        public static T Instance(string dllFileName, string className)
        {
            return (T) dllFileName.LoadClass(className);
        }

        public static T InstanceDynamic(string dllFileName, string className)
        {
            return (T) dllFileName.LoadDynamicClass(className);
        }
    }
}

